<?php
/**
 * Created by PhpStorm.
 * User: lijie
 * Date: 2018/10/31
 * Time: 20:11
 */
namespace app\reserve\validate;

use think\Validate;

class Withdraw extends Validate{

    protected $rule = [
        'id'            => ['require','number'],
        'a_id'          => ['require','number'],
        'money'         => ['require'],
        'bank_card'     => ['require','regex'=>'/^[0-9]{19}$/'],
        'openbank'      => ['require'],
        'name'          => ['require'],
        'phone'         => ['require','regex'=>'0?(13|14|15|17|18|19)[0-9]{9}'],
        'pagenum'       => ['require','number'],
        'listNum'       => ['require','number'],
    ];

    protected $message = [
        'id'            => 'id不能为空',
        'a_id'          => 'a_id不能为空',
        'money'         => 'money不能为空',
        'bank_card'     => 'bank_card格式不对(只支持储蓄卡)',
        'openbank'      => 'openbank不能为空',
        'name'          => 'name不能为空',
        'phone'         => 'phone参数错误',
        'pagenum '      => 'pagenum不能为空',
        'listNum '      => 'listNum不能为空',
    ];

    protected $scene = [
        // 添加提现
        'addWithdraw'       => ['money','bank_card','openbank','name','phone'],
        // 编辑提现
        'editWithdraw'      => ['id'],
        // 查看
        'withdrawList'      => ['pagenum','listNum'],
    ];
}